package Homework;

import java.util.stream.Stream;

public class Animal {
    String name;
    int age;
    String color;

    void eat(){
        System.out.println("名叫"+name+"的"+age+"岁的"+color+"颜色的");
    }
    void  drink(){
        System.out.println(name+"正在喝水呢");
    }
    void  swim(){
        System.out.println(name+"正在游泳");
    }

}
class Moneky extends Animal{
    Moneky(String name, int age, String color){
        this.name=name;
        this.age=age;
        this.color=color;

    }

}
class cat extends  Animal{
    cat(String name, int age, String color){
        this.name=name;
        this.age=age;
        this.color=color;
    }
}
class pig extends Animal{
    pig(String name, int age, String color){
        this.name=name;
        this.age=age;
        this.color=color;
    }
}
 class Text {
    public static void main(String[] args) {
        cat[]cats=new cat[2];
        cats[0]=new cat("小美",12,"蓝色");
        cats[1]=new cat("小帅",12,"黑色");
        for(int i=0;i< cats.length;i++){
            System.out.println(cats[i].name);
            cats[i].eat();
            cats[i].swim();
        }
    }
}

